#include <iostream>
//#include <iomanip>

using namespace std;

int main()
{
    int bud[13] = {0};
    for (int i=1; i<=12; ++i)
    {
        cin >> bud[i];
    }
    int left = 0, save = 0;
    for (int i=1; i<=12; ++i)
    {
        left += 300 - bud[i];
        if (left >= 0)
        {
            if (left > 100)
            {
                save += (left / 100);
                left -= (left / 100) * 100;
            }
        }
        else {cout << "-" << i; return 0;}
    }
    cout << save * 120 + left;
    //cout << setprecision(0) << setiosflags(ios::fixed)<<  save * 1.2;

    return 0;
}
